﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AddAuctionDetails : System.Web.UI.Page
{
    BusinessLogic obj_businesslogic = new BusinessLogic();
    DateTime effectedfrom;
    DateTime effectedto;
    string description = "";
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["userid"]== null)
        {
            Response.Redirect("Index.aspx");
        }

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int userid = Convert.ToInt32(Session["userid"].ToString());
        int itemid = Convert.ToInt32(Request.QueryString["itemid"].ToString());
        effectedfrom = Convert.ToDateTime(txteffectfrom.Text.ToString());
        effectedto = Convert.ToDateTime(txteffectto.Text.ToString());
        int starting_amount = Convert.ToInt32(txtStartingprice.Text.ToString());
        if (obj_businesslogic.addauctiondetails(effectedfrom, effectedto, description, userid, itemid, starting_amount))
        {
            lblmessage.Text = "AUCTION ADDED";
        }
    }
}